home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / PROGRAMMING / DESKLIBC / SOURCES.ZIP / DeskLib / !DLSources / Libraries / Pane / c / Other next >
Text File  |  1995-07-08  |  2KB  |  76 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for 
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #                                      
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    Pane.c
  12.     Author:  Copyright © 1994 Ainsley Pereira. Major code rewrite by Keith Hall
  13.     Version: 1.11 (30th March 94)
  14.     Purpose: Handles windows with panes.
  15. */
  16.  
  17. #include <stdlib.h>
  18.  
  19. #include "DeskLib:Pane.h"
  20.  
  21. #include "PaneDefs.h"
  22.  
  23.  
  24. extern pane_data *Pane_GetSysHandle(window_handle master)
  25. {
  26.   curpane = pane_root;
  27.  
  28.   while(curpane)
  29.   {
  30.     if(curpane->panedata.master == master)
  31.       return &curpane->panedata;
  32.     curpane = curpane->next;
  33.   }
  34.   return NULL;
  35. }
  36.  
  37.  
  38. extern int Pane_SetFlags(window_handle master, int flags)
  39. {
  40.   curpane = pane_root;
  41.  
  42.   while(curpane)
  43.   {
  44.     if(curpane->panedata.master == master)
  45.     {
  46.       if(flags>=0)
  47.         curpane->panedata.flags.value=flags;
  48.       return curpane->panedata.flags.value;
  49.     }
  50.     curpane = curpane->next;
  51.   }
  52.   return NULL;
  53. }
  54.  
  55.  
  56. extern void Pane_Delete(window_handle window)
  57. {
  58.   pane_link *lastpane=curpane=pane_root;
  59.  
  60.   while(curpane)
  61.   {
  62.     if(curpane->panedata.master == window)
  63.     {
  64.       Window_Delete(curpane->panedata.master);
  65.       Window_Delete(curpane->panedata.pane);
  66.       lastpane->next=curpane->next;
  67.       free(curpane);
  68.       if(lastpane->next==NULL)
  69.         break;
  70.       curpane=lastpane->next;
  71.     }
  72.     lastpane=curpane;
  73.     curpane = curpane->next;
  74.   }
  75. }
  76.